import { Component, OnInit } from '@angular/core';
import {MoviesService} from '../movies.service'
import {Movie} from '../movie'
import { NzMessageService } from 'ng-zorro-antd/message';
@Component({
  selector: 'app-score',
  templateUrl: './score.component.html',
  styleUrls: ['./score.component.css']
})
export class ScoreComponent implements OnInit {
  movies:Movie[];
  username='';
  constructor(private moviesService:MoviesService,private message: NzMessageService) { }
  getMyMoviesScore(){
    this.moviesService.getUserScoredMovies(this.username).subscribe(res=>{
      console.log("我的评分电影：",res);
      if(res.code==0){
        this.movies=res.data;
      }else{
        this.movies=null;
        this.message.create('error',res.msg);
      }
    })
  }
  ngOnInit(): void {
    this.username=window.localStorage['username'];
    this.getMyMoviesScore();

    //
    let h=document.body.clientHeight-200;
    document.getElementById('full').style.minHeight=h+'px';
    console.log("full:",document.getElementById('full'))
  }

}
